<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
  <head>
    <title>登录</title>
    <%@ include file="/WEB-INF/views/common/header.jsp" %>
    <style>
      .login-container {
        display: flex;
        justify-content: center;
        align-items: center;
        min-height: 100vh;
        background: linear-gradient(135deg, #71b7e6, #9b59b6);
      }
      .login-form {
        background: white;
        padding: 30px;
        border-radius: 10px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
        width: 400px;
      }
      .login-title {
        text-align: center;
        margin-bottom: 30px;
        color: #2c3e50;
      }
      .error-message {
        color: #f44336;
        text-align: center;
        margin-top: 10px;
      }
    </style>
  </head>
  <body>
    <div class="login-container">
      <div class="login-form">
        <h2 class="login-title">欢迎登录</h2>
        <form action="${pageContext.request.contextPath}/login" method="post">
          <div class="form-group">
            <label>用户名：</label>
            <input type="text" name="username" required />
          </div>
          <div class="form-group">
            <label>密码：</label>
            <input type="password" name="password" required />
          </div>
          <button type="submit">登录</button>
        </form>
        <% if (request.getParameter("error") != null) { %>
        <p class="error-message">用户名或密码错误</p>
        <% } %>
      </div>
    </div>

  </body>
</html>
